package student.aistar.day04;

/**
 * 递归
 */
public class RecursionDemo {
    public static void main(String[] args) {
        System.out.println(jie( 6));
    }

    /**
     * n!
     * @param n
     * @return
     */
    public static int jie(int n){
        //如果没有出口 -- java.
        if(n < 1)
            return 1;
        return jie(n - 1) * n;
    }

    public static int fei(int n){
        if(n == 1 || n == 2)
            return 1;
        return fei(n - 1)+fei( n - 2);
    }


//    public static int yang(int x, int y){
//        if(y < 5){
//            System.out.println(x);
//        }
//    }
}
